from toee import *
from utilities import *
from InventoryRespawn import *

def san_dialog( attachee, triggerer ):
	if (game.leader.reputation_has(32) == 1 or game.leader.reputation_has(30) == 1 or game.leader.reputation_has(29) == 1):
		attachee.float_line(11004,triggerer)
	else:
		triggerer.begin_dialog( attachee, 1 )
	return SKIP_DEFAULT

def san_first_heartbeat(attachee, triggerer):
	game.timevent_add(respawn, (attachee), 86400000 ) #86400000ms is 24 hours
	game.new_sid = 0
	return RUN_DEFAULT

def respawn(attachee):
	for box in game.obj_list_vicinity( attachee.location, OLC_CONTAINER ): 
		if box.name == 1001 and box.obj_get_int(obj_f_container_inventory_source) == 5:
			RespawnInventory(box)
			game.timevent_add(respawn, (attachee), 86400000 ) #86400000ms is 24 hours
	return
